package com.potenza.wxuser.controller;

import com.alibaba.fastjson.JSON;
import com.potenza.wxuser.annotation.RepeatSubmit;
import com.potenza.wxuser.annotation.SysLog;
import com.potenza.wxuser.model.UserInfo;
import com.potenza.wxuser.model.WeixinUser;
import com.potenza.wxuser.service.WxMiniService;
import com.ruoyi.common.core.web.domain.AjaxResult;
import io.swagger.v3.oas.annotations.headers.Header;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.ResponseEntity;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

@RestController
@RequestMapping("/c/wxtest")
@CrossOrigin
public class WxMiniTestController {

    @GetMapping("/findAll")
    @SysLog
    protected AjaxResult findAll(){
        System.out.println("findAll ----");
        return new AjaxResult(200,"Success","FindAll");
    }

    @GetMapping("/findById/{id}")
    public AjaxResult findById(@PathVariable String id){
        System.out.println("findById----" + id);
        return new AjaxResult(200,"Success","findById");
    }

    @GetMapping("/test1")
    @RepeatSubmit(limit = 30)
    public AjaxResult test1(String openid){
        System.out.println("openid=" + openid);

        return new AjaxResult(200,"Success",openid);
    }
}

